home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
comm
/
mebbs
/
mn_ansitest.lha
/
ANSITEST
/
ansitest.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1994-10-26
|
7KB
|
302 lines
/*template*/
parse arg LineNumber
signal on SYNTAX
signal on ERROR
options results
DoorName = "AnsiTest"
if( ~show( 'l', "mebbsarexx.library" ) )then do
if( ~addlib( "mebbsarexx.library", 0, -30, 0 ) )then do
say "Could not open library"
exit 10
end
end
ver = " AnsiTest.Rexx v.160 by /\/\r. Ed"
sysop = 'ED_KOLAR' /* PUT YOUR NAME HERE */
Author = "/\/\r. ED"
/* VariableNumbers: */
call getvar DoorName,LineNumber,1
username=result
call getvar DoorName,LineNumber,21
handlename=result
/* get GFX mode */
call getvar doorname,LineNumber,8
mode=result
gfx=mode
if mode = 1 then mode = "Color"
ELSE mode = "B/White"
if mode = "Color" then colr = "NONE"
ELSE colr = "MONO"
IF gfx ~= "0" THEN DO
black = '
' ; blackback = '
'
red = '
' ; redback = '
'
green = '
' ; greenback = '
'
yellow = '
' ; yellowback = '
'
blue = '
' ; blueback = '
'
magenta = '
' ; magentaback = '
'
cyan = '
' ; cyanback = '
'
white = '
' ; whiteback = '
'
italics = '
'
bold = '
'
normal = '
'
cls = '0C'x||''
yesno = "
(
y
/
N
)"
noyes = "
(
Y
/
n
)"
END
ELSE DO
black = '' ; blackback = ''
red = '' ; redback = ''
green = '' ; greenback = ''
yellow = '' ; yellowback = ''
blue = '' ; blueback = ''
magenta = '' ; magentaback = ''
cyan = '' ; cyanback = ''
white = '' ; whiteback = ''
italics = ''
bold = ''
normal = ''
cls = '0C'x
yesno = '(y/N)'
noyes = '(Y/n)'
end
call getvar DoorName,LineNumber,9
width=result
if width < 80 then call bad_width
if gfx = 0 then do
string = "Your terminal is in non-graphics mode, according to the UserLog.";call output
string = "Do you want me to go ahead anyway? "yesno;call getkeyrn
ans = upper(hot)
if ans = "Y" then signal start
call exit_normal
end
signal start
bad_width:
string = "You have listed that your terminal";call output
string = "width is only "width;call output
string = "If this is not true then you must";call output
string = "change your logged preferences. To do this,";call output
string = "hit (A) on the screen that follows";call output
string = "and change your setting for (G) to";call output
string = "something otherthan 0.";call output
string = "Do you want to go ahead and try this";call output
string = "test anyway? "noyes;call getkeyry
ans = upper(hot)
if ans = "N" then signal exit_normal40
wide = "N"
return
/* END */
START:
file = "doors:ansitest/ansiscreen"
call blank
call blank
string = cyan" You may find it to be helpful to take a Snap of this screen";call output
string = " with something like "magenta""Screen Grabber""cyan" or "magenta""GrabIFF""cyan" to study later.";call output;call blank;call getreturn
string = file;call readgr
call blank
;call getreturn
call check
string = cls;call output;call blank;call blank;call blank
string = cyan"You've been using "yellow||doorname||cyan" by "white||author||cyan".";call output
call blank
string = cyan"Thank you, "magenta||username||cyan", please press ["yellow"RETURN"cyan"].....";call output
address command 'wait 1'
address
if wide = "N" then signal exit_normal40
signal exit_normal
/* End of script */
/************************* Procedures ************************/
Exit_Normal:
call blank;call blank;call blank;call blank;call blank
string = " "yellowback||black||bold" Now returning you to that wonderful Chalkboard I & II BBS "normal||cyan;call output
address command 'wait 2'
address
call Exit_Door DoorName,LineNumber
exit 0
Exit_Normal40:
call blank;call blank;call blank;call blank;call blank
string = normal" "yellowback||black||bold" Now returning you to that wonderful ";call output
string = normal" "yellowback||black||bold" Chalkboard I & II BBS "normal||cyan;call output
address command 'wait 2'
address
call Exit_Door DoorName,LineNumber
exit 0
GETRETURN:
string = CYAN||ITALICS" Press RETURN when ready..."NORMAL
call hotkey doorname,linenumber,string
hot=""
return
GETKEYRN:
call hotkey doorname,linenumber,string
hot=upper(result)
if hot = "Y" then do
string =green" Yes"
call output
end
else do /* yesno = "
(
y
/
N
)"*/
hot = "N"
string = red" No"
call output
end
return
GETKEYRY:
call hotkey doorname,linenumber,string
hot=upper(result)
if hot = "N" then do
string = red" No"
call output
end /* noyes = "
(
Y
/
n
)"*/
else do
hot = "Y"
string = green" Yes"
call output
end
return
GETKEY:
call hotkey doorname,linenumber,string
hot=result
return
OUTPUT:
call message doorname,linenumber,string,1
return
BLANK:
blnk = " "
call message doorname,linenumber,blnk,1
return
GETOUT:
call blank
call Exit_Door DoorName,LineNumber
exit 0
Carrier:
call CDetect doorname,linenumber
cd=result
return
drophim:
call HangUp DoorName,LineNumber
exit 0
readgr:
call ReadGra doorname,linenumber,string
return
readfl:
call ReadFile doorname,linenumber,string
return
lclmsg:
call LocalMessage doorname,linenumber,string,1
return
/*----------------------CHECK FOR DROPPED CARRIER------------------------*/
check: /* check for lost carrier or spaced-out player */
call carrier
if cd = "No carrier!" then signal drophim
return
/************************* End of Procedures ************************/
/**************************ERROR******Procedures*****************************/
IOERR:
err_line = SIGL ; sev = RC ; code = sev
string ="**Crash** Looks like we got an I/O error somewhere!"
call output
signal log_it
ERROR:
err_line = SIGL ; sev = RC ; code = sev
string ="**Crash** Looks like we got some sort of error!"
call output
signal log_it
SYNTAX:
err_line = SIGL ; sev = RC ; code = sev
string ="**Crash** Looks like we got a syntax error somewhere!"
call output
signal log_it
log_it:
Crash_N_Burn:
Wrap_it_up:
string ="Looks like we're gonna have to bail outta this mess......"
call output
/*--------------------------------LOG-ERRORS----------------------------*/
call blank
string = "A fatal error has occured!"
call delay(50)
call blank
string = "Inform Sysop to check the error log!"
call output
call delay(50)
if ~exists('bbs:logs') then makedir('BBS:Logs')
if ~exists('BBS:Logs/Errlog') then call open(err,'BBS:Logs/Errlog','W')
else call open(err,'BBS:Logs/Errlog','A')
call writeln(err,date() time());call writeln(err,name" - "||doorname)
call writeln(err,"Line - "err_line" Code - "code" User - "username);call writeln(err,errortext(code))
call writeln(err,"");call close(err)
call Exit_Door doorname,linenumber
exit 0